<%@ page import="cn.edu.hbcit.text1.Account" %><%--
  Created by IntelliJ IDEA.
  User: 11507
  Date: 2019/6/20
  Time: 16:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>状态查询</title>
</head>
<body>
<div class="container">
    <%@include file="template/header.jsp" %>
    <%
        String acount = request.getParameter("account");
        String password = request.getParameter("password");
        Account acct = new Account();
        boolean tempFlag = acct.findAcount(acount, password);
        if (tempFlag) {
            out.print("<div class=\"alert alert-success\">\n" +
                    "  <strong>成功!</strong> 登陆成功。\n" +
                    "</div>");
            out.println("<div class=\"alert alert-info\">\n" +
                    "        <strong>欢迎访问</strong>");
//            response.sendRedirect("login.jsp");
            out.print(acount);
            out.print("</div>");
        } else {
            out.print("<div class=\"alert alert-danger\">\n" +
                    "  <strong>失败!</strong> 账号不存在或用户名/密码错误！\n" +
                    "</div>");
//            response.sendRedirect("register.jsp");
        }
    %>

    <%
        ServletContext context = request.getServletContext();
        context.setAttribute("acountNumber", acount);
    %>

    <a href="student_main.jsp">
        <button type="button" class="btn btn-outline-secondary">进入系统</button>
    </a>


    <%@include file="template/footer.jsp" %>
</div>
<%@include file="template/link.jsp" %>
<%@include file="template/autoClick.jsp" %>
</body>
</html>
